package com.great.medical.goods.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.great.medical.common.PageParams;
import com.great.medical.goods.db.mapper.ProtocolGoodsMapper;
import com.great.medical.goods.db.model.ProtocolGoods;
import com.great.medical.goods.service.ProtocolGoodsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
@Primary
@Slf4j
public class ProtocolGoodsServiceImpl extends ServiceImpl<ProtocolGoodsMapper, ProtocolGoods> implements ProtocolGoodsService {
    @Override
    public IPage<ProtocolGoods> getPageList(Map map) {
        PageParams pageParams = new PageParams(map);
        final QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.orderByDesc("create_time");
        final IPage<ProtocolGoods> iPage = this.getBaseMapper().selectPage(pageParams, queryWrapper);
        return iPage;
    }
}
